**************************************************************************
** title:	Political institutions and coups in dictatorships 			**
** author:	Nam Kyu Kim and Jun Koga Sudduth							**
** Journal:	Comparative Political Studies 					 			**
** date: 	December 2020												**
**************************************************************************

*** ssc install estout
*** ssc install cem
use "data.dta", clear

******************************************************************
*** Analyses for Main Text
******************************************************************
 
*** Table 1

global X "gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

set more off	
eststo clear
eststo: qui logit anycoupatt_fin gwf_supportparty $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui logit anycoupatt_fin gwf_legislature $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui logit anycoupatt_fin gwf_partylegis $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 

eststo: qui logit reshuffleatt_fin gwf_supportparty $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
margins, at(gwf_supportparty=(0 1))
eststo: qui logit reshuffleatt_fin gwf_legislature $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
margins, at(gwf_legislature=(0 1))
eststo: qui logit reshuffleatt_fin gwf_partylegis $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
margins, at(gwf_partylegis=(0 1))

eststo: qui logit rechangeatt_fin gwf_supportparty $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
margins, at(gwf_supportparty=(0 1))
eststo: qui logit rechangeatt_fin gwf_legislature $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
margins, at(gwf_legislature=(0 1))
eststo: qui logit rechangeatt_fin gwf_partylegis $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
margins, at(gwf_partylegis=(0 1))  
 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 
 
	 
*** Numbers for Figure 1

ta rechangeatt_fin
display 0.0421 * 0.8
* .03368 as a meaningful threshold 

qui logit rechangeatt_fin i.gwf_supportparty $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
margins, dydx(gwf_supportparty )  level(90) 
*  -.0083195  [  -.022199      .00556]

qui logit rechangeatt_fin i.gwf_legislature $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
margins, dydx( gwf_legislature ) level(90) 
*  .0019254   [ -.0142578    .0181085 ]

qui logit rechangeatt_fin i.gwf_partylegis $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
margins, dydx( gwf_partylegis ) level(90) 
*    -.0027102   [  -.0158966    .0104761]


ta reshuffleatt_fin 
display 0.0255*0.8     
* .0204 as a meaningful threshold 

qui logit reshuffleatt_fin  i.gwf_supportparty $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
margins, dydx(gwf_supportparty )  level(90) 
*     -.0233556  [    -.0343482   -.0123631]

qui logit reshuffleatt_fin  i.gwf_legislature $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode)
margins, dydx( gwf_legislature ) level(90) 
*  -.0159022  [  -.0254758   -.0063287]

qui logit reshuffleatt_fin  i.gwf_partylegis $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
margins, dydx( gwf_partylegis ) level(90) 
*    -.0198906 [-.0298341   -.0099472 ]


*** Table 2

global X "gwf_supportparty gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

preserve
drop if gwf_supportparty == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5), tr(gwf_supportparty)

eststo clear
eststo: qui logit anycoupatt_fin $X c.anyattyrs##c.anyattyrs##c.anyattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore
 
 
global X "gwf_legislature gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

preserve
drop if  gwf_legislature == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1)  anyattyrs(#5),  tr( gwf_legislature)
eststo: qui logit anycoupatt_fin $X c.anyattyrs##c.anyattyrs##c.anyattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore


global X "gwf_partylegis gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

preserve
drop if gwf_partylegis == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5),   tr(gwf_partylegis)
eststo: qui logit anycoupatt_fin $X c.anyattyrs##c.anyattyrs##c.anyattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore 

esttab, star(+ .1 * .05 ** .01) label noomitted nobase 
 
	
*** Table 3

set more off
eststo clear
global X "Lallp_regime_party gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"
preserve
drop if Lallp_regime_party == .  
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5), tr( Lallp_regime_party) 
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore 


global X "gwf_party_ind gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold "

preserve
drop if gwf_party_noind == 1 
drop if  gwf_party_ind  == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1)  anyattyrs(#5), tr( gwf_party_ind  ) 
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore 
 
global X "gwf_localbranch gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold "

preserve
drop if gwf_nobranch == 1
drop if gwf_localbranch == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5), tr(gwf_localbranch)

 
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode)
restore 

global X " Ld_allp_origin8   gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

preserve
drop if Lnon_revolution_party == 1 
drop if  Ld_allp_origin8   == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1)  anyattyrs(#5), tr( Ld_allp_origin8  )
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights]  , cluster(cowcode) 
restore

global X "gwf_insider_legis   gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold "
preserve
drop if gwf_outsider_legis == 1
drop if   gwf_insider_legis  == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1)  anyattyrs(#5), tr(  gwf_insider_legis   )
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore
 
global X "gwf_outsider_legis   gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

preserve
drop if gwf_insider_legis == 1
drop if   gwf_outsider_legis == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1)  anyattyrs(#5), tr(  gwf_outsider_legis   )
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore
  
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 
	 
	
******************************************************************
*** Analyses for Supplementary Appendix
******************************************************************
set more off
*** Table A2

global X "gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

set more off	
eststo clear
eststo: qui logit reshuffleatt_fin  Lallp_regime_party $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin  Lallp_regime_party $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 

eststo: qui logit reshuffleatt_fin gwf_party_ind gwf_party_noind $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_party_ind gwf_party_noind $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 

eststo: qui logit reshuffleatt_fin gwf_localbranch gwf_nobranch $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_localbranch gwf_nobranch $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
 
eststo: qui logit reshuffleatt_fin  Ld_allp_origin8 Lnon_revolution_party $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin  Ld_allp_origin8 Lnon_revolution_party $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
 
eststo: qui logit reshuffleatt_fin gwf_insider_legis  gwf_outsider_legis  $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_insider_legis  gwf_outsider_legis  $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 

 
*** Table A3

la var lag_aow_opposition "Opposition parties"	 

global X "lag_aow_opposition gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"
	 
set more off	
eststo clear
  
eststo: qui logit anycoupatt_fin gwf_supportparty $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui logit anycoupatt_fin gwf_legislature $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui logit anycoupatt_fin gwf_partylegis $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 

eststo: qui logit reshuffleatt_fin gwf_supportparty $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
margins, at(gwf_supportparty=(0 1))
eststo: qui logit reshuffleatt_fin gwf_legislature $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
margins, at(gwf_legislature=(0 1))
eststo: qui logit reshuffleatt_fin gwf_partylegis $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
margins, at(gwf_partylegis=(0 1))

eststo: qui logit rechangeatt_fin gwf_supportparty $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
margins, at(gwf_supportparty=(0 1))
eststo: qui logit rechangeatt_fin gwf_legislature $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
margins, at(gwf_legislature=(0 1))
eststo: qui logit rechangeatt_fin gwf_partylegis $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
margins, at(gwf_partylegis=(0 1))  
 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase order(gwf_supportparty gwf_legislature gwf_partylegis) drop(*yrs*)	

*** Table A4

global X "gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold "
set more off	
eststo clear 
 
eststo: qui logit anycoupsucc_fin gwf_supportparty $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui logit anycoupsucc_fin gwf_legislature $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui logit anycoupsucc_fin gwf_partylegis $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 

eststo: qui logit reshufflesucc_fin gwf_supportparty $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshufflesucc_fin gwf_legislature $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshufflesucc_fin gwf_partylegis $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 

eststo: qui logit  rechangesucc_fin gwf_supportparty $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit  rechangesucc_fin gwf_legislature $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit  rechangesucc_fin gwf_partylegis $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 
  
  
*** Table A5
	  
global X "gwf_supportparty gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

preserve
drop if gwf_supportparty == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5), tr(gwf_supportparty)

eststo clear
eststo: qui logit reshufflesucc_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangesucc_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore

global X "gwf_legislature gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

preserve
drop if  gwf_legislature == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1)  anyattyrs(#5),  tr( gwf_legislature)
eststo: qui logit reshufflesucc_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangesucc_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore

global X "gwf_partylegis gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

preserve
drop if gwf_partylegis == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1)   anyattyrs(#5),   tr(gwf_partylegis)
eststo: qui logit reshufflesucc_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangesucc_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore 

esttab, star(+ .1 * .05 ** .01) label noomitted nobase 	 


*** Table A6 
  
global X "gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold ln_banks_protest_t1  war_PO civilwar_PO"

set more off	
eststo clear
eststo: qui logit reshuffleatt_fin gwf_supportparty $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_legislature $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_partylegis $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 

eststo: qui logit rechangeatt_fin gwf_supportparty $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_legislature $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_partylegis $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 

*** Table A7   

global X "gwf_supportparty gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold  ln_banks_protest_t1  war_PO civilwar_PO"
 
set more off	
eststo clear
preserve
drop if gwf_supportparty== .
cem ln_banks_protest_t1(#3)  postcold(#1) war_PO(#1)  civilwar_PO(#1) gwf_leadermil(#1)     ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5), tr(gwf_supportparty)
eststo clear
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore
  
global X "gwf_legislature gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold ln_banks_protest_t1  war_PO civilwar_PO"

preserve
drop if  gwf_legislature == .
cem ln_banks_protest_t1(#3) postcold(#1)  war_PO(#1)  civilwar_PO(#1)  gwf_leadermil (#1)   ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5),  tr( gwf_legislature)
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore

global X "gwf_partylegis gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold ln_banks_protest_t1  war_PO civilwar_PO"

preserve
drop if gwf_partylegis== .
cem ln_banks_protest_t1(#3) postcold(#1)   war_PO(#1)  civilwar_PO(#1) gwf_leadermil (#1)     ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5),   tr(gwf_partylegis)
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 
      
*** Table A8 

global X "gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold lag1_lnmilex_MC  lag1_lnmilper_MC  Burin_counterbalancing"

eststo clear
eststo: qui logit reshuffleatt_fin gwf_supportparty $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_legislature $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_partylegis $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 

eststo: qui logit rechangeatt_fin gwf_supportparty $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_legislature $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_partylegis $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 
  
*** Table A9   

global X "gwf_supportparty gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold  lag1_lnmilex_MC  lag1_lnmilper_MC"
 
set more off	
eststo clear
preserve
drop if gwf_supportparty== .
cem lag1_lnmilex_MC ( 10.37   11.85  13.6)  postcold(#1)  lag1_lnmilper_MC (2.48  3.81  5.1)  gwf_leadermil(#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5), tr(gwf_supportparty)
eststo clear
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore
  
  
global X "gwf_legislature gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold lag1_lnmilex_MC  lag1_lnmilper_MC"
preserve
drop if  gwf_legislature == .
cem  lag1_lnmilex_MC ( 10.37   11.85  13.6)  postcold(#1)  lag1_lnmilper_MC (2.48  3.81  5.1)   gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5),  tr( gwf_legislature)
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore


global X "gwf_partylegis gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold lag1_lnmilex_MC  lag1_lnmilper_MC"

preserve
drop if gwf_partylegis== .
cem lag1_lnmilex_MC ( 10.37   11.85  13.6)  postcold(#1)  lag1_lnmilper_MC (2.48  3.81  5.1)  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5),   tr(gwf_partylegis)
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 

*** Table A10  
     
global X "gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold imf"

set more off	
eststo clear
eststo: qui logit reshuffleatt_fin gwf_supportparty $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_legislature $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_partylegis $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 

eststo: qui logit rechangeatt_fin gwf_supportparty $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_legislature $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_partylegis $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase    

*** Table A11

global X "gwf_supportparty gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold imf "

set more off	
eststo clear
preserve
drop if gwf_supportparty== .
cem imf (#1) gwf_leadermil (#1) postcold(#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5), tr(gwf_supportparty)
eststo clear
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore
 
global X "gwf_legislature gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold imf "

preserve
drop if  gwf_legislature == .
cem imf (#1)  gwf_leadermil (#1) postcold(#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5),  tr( gwf_legislature)
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore

global X "gwf_partylegis gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold imf "

preserve
drop if gwf_partylegis== .
cem imf (#1) gwf_leadermil (#1) postcold(#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5),   tr(gwf_partylegis)
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 

*** Table A12
  
global X "gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold  p_opp_gain365 p_riots365"

eststo clear
eststo: qui logit reshuffleatt_fin gwf_supportparty $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_legislature $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_partylegis $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 

eststo: qui logit rechangeatt_fin gwf_supportparty $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_legislature $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_partylegis $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode)  
esttab, star(+ .1 * .05 ** .01) label noomitted nobase  
 
*** Table A13

global X "gwf_supportparty gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold p_opp_gain365 p_riots365"
set more off
eststo clear
preserve
drop if gwf_supportparty== .
cem postcold(#1)  p_opp_gain365 (#1) p_riots365 (#1) gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5), tr(gwf_supportparty)
eststo clear
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore
 
global X "gwf_legislature gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold  p_opp_gain365 p_riots365"

preserve
drop if  gwf_legislature == .
cem  postcold(#1)  p_opp_gain365 (#1) p_riots365 (#1)  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5),  tr( gwf_legislature)
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore

global X "gwf_partylegis gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold p_opp_gain365 p_riots365"

preserve
drop if gwf_partylegis== .
cem  postcold(#1)  p_opp_gain365 (#1) p_riots365 (#1)  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) anyattyrs(#5),   tr(gwf_partylegis)
eststo: qui logit reshuffleatt_fin $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs [iweight=cem_weights], cluster(cowcode) 
eststo: qui logit rechangeatt_fin $X c.rechattyrs##c.rechattyrs##c.rechattyrs [iweight=cem_weights], cluster(cowcode) 
restore 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 

*** Table A14
  
global X "gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW  decade*"

set more off	
eststo clear
eststo: qui logit anycoupatt_fin gwf_supportparty $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui logit anycoupatt_fin gwf_legislature $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui logit anycoupatt_fin gwf_partylegis $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 

eststo: qui logit reshuffleatt_fin gwf_supportparty $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_legislature $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_partylegis $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 

eststo: qui logit rechangeatt_fin gwf_supportparty $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_legislature $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_partylegis $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
 esttab, star(+ .1 * .05 ** .01) label noomitted nobase 

*** Table A15   

global X "gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold i.e_regionpol"

set more off	
eststo clear
eststo: qui logit anycoupatt_fin gwf_supportparty $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui logit anycoupatt_fin gwf_legislature $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui logit anycoupatt_fin gwf_partylegis $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 

eststo: qui logit reshuffleatt_fin gwf_supportparty $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_legislature $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_partylegis $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 

eststo: qui logit rechangeatt_fin gwf_supportparty $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_legislature $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_partylegis $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 



*** Table A16 
		
global X "gwf_leadermil  ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW  postcold"
   
set more off	
eststo clear
foreach x of varlist gwf_supportparty gwf_legislature gwf_partylegis  {
	eststo: qui xtlogit  anycoupatt_fin `x'  $X c.anyattyrs##c.anyattyrs##c.anyattyrs, re i(cowcode) 
}

foreach x of varlist gwf_supportparty gwf_legislature gwf_partylegis  {
	eststo: qui xtlogit  reshuffleatt_fin `x'  $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, re i(cowcode) 
}

foreach x of varlist gwf_supportparty gwf_legislature gwf_partylegis  {
	eststo: qui xtlogit  rechangeatt_fin `x'  $X c.rechattyrs##c.rechattyrs##c.rechattyrs, re i(cowcode) 
}
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 
  
	 

*** Table A17   

la var gwf_legislature "Legislature"
la var gwf_partylegis "Party and Legislature"
	
foreach var of varlist gwf_supportparty gwf_legislature gwf_partylegis gwf_leadermil ll_pop_PW ll_rgdpe_PW lag_growth_rgdpe_PW  {
	cap drop `var'_m 
	by cowcode: egen `var'_m = mean(`var')
	cap drop `var'_d
	by cowcode: gen `var'_d = `var'-`var'_m

	local l`var' : variable label `var'
	label var `var'_m "`l`var''"
	label var `var'_d "`l`var''"
}


set more off	
eststo clear
eststo: qui logit anycoupatt_fin gwf_supportparty_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
	gwf_supportparty_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m  postcold c.anyattyrs##c.anyattyrs##c.anyattyrs, cl(cowcode)
eststo: qui logit anycoupatt_fin gwf_legislature_d  gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d ///
	gwf_legislature_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m  postcold c.anyattyrs##c.anyattyrs##c.anyattyrs, cl(cowcode)
eststo: qui logit anycoupatt_fin gwf_partylegis_d  gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d ///
	gwf_partylegis_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m  postcold c.anyattyrs##c.anyattyrs##c.anyattyrs, cl(cowcode)

eststo: qui logit reshuffleatt_fin gwf_supportparty_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
	gwf_supportparty_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m postcold c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cl(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_legislature_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
	gwf_legislature_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m postcold c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cl(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_partylegis_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
	gwf_partylegis_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m postcold c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cl(cowcode) 

eststo: qui logit rechangeatt_fin gwf_supportparty_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
  gwf_supportparty_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m postcold c.rechattyrs##c.rechattyrs##c.rechattyrs, cl(cowcode)
eststo: qui logit rechangeatt_fin gwf_legislature_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
  gwf_legislature_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m  postcold c.rechattyrs##c.rechattyrs##c.rechattyrs, cl(cowcode)
eststo: qui logit rechangeatt_fin gwf_partylegis_d  gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
	gwf_partylegis_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m postcold c.rechattyrs##c.rechattyrs##c.rechattyrs, cl(cowcode)

esttab, star(+ .1 * .05 ** .01) label noomitted nobase order(gwf_supportparty_d gwf_legislature_d gwf_partylegis_d gwf_supportparty_m gwf_legislature_m gwf_partylegis_m)	

*** Table A18   
	
set more off	
eststo clear
eststo: qui xtlogit anycoupatt_fin gwf_supportparty_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
	gwf_supportparty_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m  postcold c.anyattyrs##c.anyattyrs##c.anyattyrs , re
eststo: qui xtlogit anycoupatt_fin gwf_legislature_d  gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d ///
	gwf_legislature_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m  postcold c.anyattyrs##c.anyattyrs##c.anyattyrs , re
eststo: qui xtlogit anycoupatt_fin gwf_partylegis_d  gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d ///
	gwf_partylegis_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m  postcold c.anyattyrs##c.anyattyrs##c.anyattyrs , re

eststo: qui xtlogit reshuffleatt_fin gwf_supportparty_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
	gwf_supportparty_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m postcold c.shuffattyrs##c.shuffattyrs##c.shuffattyrs , re 
eststo: qui xtlogit reshuffleatt_fin gwf_legislature_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
	gwf_legislature_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m postcold c.shuffattyrs##c.shuffattyrs##c.shuffattyrs , re 
eststo: qui xtlogit reshuffleatt_fin gwf_partylegis_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
	gwf_partylegis_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m postcold c.shuffattyrs##c.shuffattyrs##c.shuffattyrs , re 

eststo: qui xtlogit rechangeatt_fin gwf_supportparty_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
  gwf_supportparty_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m postcold c.rechattyrs##c.rechattyrs##c.rechattyrs, re
eststo: qui xtlogit rechangeatt_fin gwf_legislature_d gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
  gwf_legislature_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m  postcold c.rechattyrs##c.rechattyrs##c.rechattyrs, re
eststo: qui xtlogit rechangeatt_fin gwf_partylegis_d  gwf_leadermil_d  ll_rgdpe_PW_d lag_growth_rgdpe_PW_d ll_pop_PW_d  ///
	gwf_partylegis_m gwf_leadermil_m  ll_rgdpe_PW_m lag_growth_rgdpe_PW_m ll_pop_PW_m postcold c.rechattyrs##c.rechattyrs##c.rechattyrs, re

esttab, star(+ .1 * .05 ** .01) label noomitted nobase order(gwf_supportparty_d gwf_legislature_d gwf_partylegis_d gwf_supportparty_m gwf_legislature_m gwf_partylegis_m)	


*** Table A19   

global X " ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

set more off	
eststo clear
eststo: qui logit reshuffleatt_fin gwf_supportparty gwf_military $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_legislature   gwf_military $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_partylegis   gwf_military $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 

eststo: qui logit rechangeatt_fin gwf_supportparty gwf_military  $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_legislature  gwf_military $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_partylegis   gwf_military $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 

eststo: qui logit reshuffleatt_fin gwf_supportparty gwf_military  gwf_personal gwf_monarch $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_legislature   gwf_military gwf_personal gwf_monarch $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_partylegis   gwf_military  gwf_personal gwf_monarch $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 

eststo: qui logit rechangeatt_fin gwf_supportparty gwf_military  gwf_personal gwf_monarch   $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_legislature  gwf_military  gwf_personal gwf_monarch  $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_partylegis   gwf_military  gwf_personal gwf_monarch  $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 

*** Table A20    

set more off	
eststo clear
eststo: qui logit reshuffleatt_fin gwf_supportparty##gwf_military $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_legislature##gwf_military $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui logit reshuffleatt_fin gwf_partylegis##gwf_military $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 

eststo: qui logit rechangeatt_fin gwf_supportparty##gwf_military $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_legislature##gwf_military $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui logit rechangeatt_fin gwf_partylegis##gwf_military $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 
	
 
*** Table A21  	

global X "gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold "
 
eststo clear
eststo: qui mlogit multiattdv_fin gwf_supportparty $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui mlogit multiattdv_fin gwf_legislature $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui mlogit multiattdv_fin gwf_partylegis $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 

*** Table A22

global X " gwf_supportparty  gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold "
eststo clear
preserve
drop if gwf_supportparty== .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5), tr(gwf_supportparty)
eststo: qui mlogit multiattdv_fin  $X c.anyattyrs##c.anyattyrs##c.anyattyrs [iweight=cem_weights], cluster(cowcode) 
restore
 
global X " gwf_legislature  gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold "
preserve
drop if  gwf_legislature == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5), tr( gwf_legislature )
eststo: qui mlogit multiattdv_fin  $X c.anyattyrs##c.anyattyrs##c.anyattyrs [iweight=cem_weights], cluster(cowcode) 
restore

global X " gwf_partylegis    gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold "
preserve
drop if  gwf_partylegis == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5), tr(gwf_partylegis   )
eststo: qui mlogit multiattdv_fin  $X c.anyattyrs##c.anyattyrs##c.anyattyrs [iweight=cem_weights], cluster(cowcode) 
restore
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 

*** Table A23
  
eststo clear
eststo: qui mlogit  multisuccessdv_fin gwf_supportparty $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui mlogit  multisuccessdv_fin gwf_legislature $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui mlogit  multisuccessdv_fin gwf_partylegis $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode)
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 

*** Table A24

global X " gwf_supportparty  gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold "
eststo clear
preserve
drop if gwf_supportparty == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5), tr(gwf_supportparty)

eststo clear
eststo: qui mlogit  multisuccessdv_fin $X c.anyattyrs##c.anyattyrs##c.anyattyrs [iweight=cem_weights], cluster(cowcode) 
restore
 
global X " gwf_legislature  gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold "
preserve
drop if  gwf_legislature == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5), tr( gwf_legislature )
eststo: qui mlogit multisuccessdv_fin $X c.anyattyrs##c.anyattyrs##c.anyattyrs [iweight=cem_weights], cluster(cowcode) 
restore
 
global X " gwf_partylegis    gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold "
preserve
drop if  gwf_partylegis == .
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5), tr(gwf_partylegis   )
eststo: qui mlogit    multisuccessdv_fin $X c.anyattyrs##c.anyattyrs##c.anyattyrs [iweight=cem_weights], cluster(cowcode) 
restore
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 

 
 
*** Table A25

use "imputed.dta", clear

mi import flong, m(imp) id(cowcode year) 
mi stset, clear
mi xtset cowcode year

global X "gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold"

la var gwf_supportparty "Support party"
la var gwf_legislature "Legislature"
la var gwf_partylegis "Party and legislature"
la var postcold "Post-Cold War"
la var gwf_leadermil "Military leader" 
la var ll_rgdpe_PW "ln(GDP/capita)"
la var lag_growth_rgdpe_PW "Economic Growth"
la var ll_pop_PW "ln(Population)"

set more off	
eststo clear
eststo: qui mi est, post cmdok: logit anycoupatt_fin gwf_supportparty $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui mi est, post cmdok: logit anycoupatt_fin gwf_legislature $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 
eststo: qui mi est, post cmdok: logit anycoupatt_fin gwf_partylegis $X c.anyattyrs##c.anyattyrs##c.anyattyrs, cluster(cowcode) 

eststo: qui mi est, post cmdok: logit reshuffleatt_fin gwf_supportparty $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui mi est, post cmdok: logit reshuffleatt_fin gwf_legislature $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 
eststo: qui mi est, post cmdok: logit reshuffleatt_fin gwf_partylegis $X c.shuffattyrs##c.shuffattyrs##c.shuffattyrs, cluster(cowcode) 

eststo: qui mi est, post cmdok: logit rechangeatt_fin gwf_supportparty $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui mi est, post cmdok: logit rechangeatt_fin gwf_legislature $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
eststo: qui mi est, post cmdok: logit rechangeatt_fin gwf_partylegis $X c.rechattyrs##c.rechattyrs##c.rechattyrs, cluster(cowcode) 
esttab, star(+ .1 * .05 ** .01) label noomitted nobase 
 
*** Table A26-A28
	
preserve
keep if gwf_supportparty  != .
imb  gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold anyattyrs, treatment(gwf_supportparty) 
mat i1= r(imbal)
mat i1=i1[1..6,1..2]
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1) anyattyrs(#5), tr(gwf_supportparty)
mat i2= r(imbal)
mat i2=i2[1..6,1..2]
matrix i=i1,i2
mat list i
outtable using "balance1", mat(i)  replace center f(%9.3f) nobox label
restore

preserve
keep if gwf_legislature  != .
imb  gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold anyattyrs, treatment(gwf_legislature) 
mat i1= r(imbal)
mat i1=i1[1..6,1..2]
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1)  anyattyrs(#5),  tr( gwf_legislature)
mat i2= r(imbal)
mat i2=i2[1..6,1..2]
matrix i=i1,i2
mat list i
outtable using "balance2", mat(i)  replace center f(%9.3f) nobox label
restore


preserve
keep if gwf_partylegis  != .
imb  gwf_leadermil ll_rgdpe_PW lag_growth_rgdpe_PW ll_pop_PW postcold anyattyrs, treatment(gwf_partylegis) 
mat i1= r(imbal)
mat i1=i1[1..6,1..2]
cem  gwf_leadermil (#1) ll_rgdpe_PW (8.91 9.96 11.25) lag_growth_rgdpe_PW (.004 .05 .09) ll_pop_PW (1.25 2.17 3.12) postcold (#1)   anyattyrs(#5),   tr(gwf_partylegis)
mat i2= r(imbal)
mat i2=i2[1..6,1..2]
matrix i=i1,i2
mat list i
outtable using "balance3", mat(i)  replace center f(%9.3f) nobox label
restore
 
 
 ************
 ************
 ***** END 
 ************
 ************


